<template>
	<view>
		<view class="head">
			<image src="../../../../static/icons/leju-logo.png" mode=""></image>
		</view>
		<view class="from">
			<view class="item">
				<input type="text" placeholder="手机号" v-model="phone" />
			</view>
			<view class="item">
				<input type="password" placeholder="登录密码" v-model="password" />
			</view>
			<view class="item">
				<input type="text" placeholder="用户名" v-model="username" />
			</view>
			<view class="item">
				<input type="text" placeholder="昵称" v-model="nickname" />
			</view>
			<view class="item">
				<input type="text" placeholder="验证码" />
			</view>
			<view class="item" @tap="signSuccess">
				<text>注 册</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { register } from "../../../../api/user/index.js"
	export default {
		data() {
			return {
				phone:"",
				username:"",
				password:"",
				nickname:""
			};
		},
		methods: {
			signSuccess() {
				register({
					birthday: "",
					city: "",
					email: "",
					growth: 0,
					historyIntegration: 0,
					icon: "/static/icons/my-head.jpg",
					integration: 0,
					isDisabled: 0,
					memberLevelId: "",
					nickname: this.nickname,
					password: this.password,
					personalizedSignature: "",
					phone: this.phone,
					realname: "",
					sex: 0,
					sourceType: 0,
					status: 1,
					username: this.username,
					wxOpenId: ""
				}).then(res=>{
					console.log(res)
					if (res.success) {
						uni.navigateTo({
							url:"/pages/user/login/login"
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.head {
	width: 160rpx;
	height: 160rpx;
	border-radius: 50%;
	overflow: hidden;
	margin: 128rpx auto 72rpx;
	image {
		display: block;
		width: 100%;
		height: 100%;
	}
}
.from {
	padding: 24rpx 70rpx 0;
	.item {
		box-sizing: border-box;
		height: 100rpx;
		box-shadow: 0 0 60rpx 0 rgba(43,86,112,.1);
		border-radius: 2.5rem;
		padding: 32rpx;
		color: #333;
		margin: 48rpx 0;
		input {
			margin-left: 20rpx;
		}
		&:last-child {
			width: 600rpx;
			background-color: rgb(53, 78, 68);
			color: rgb(255, 255, 255);
			font-size: 30rpx;
			text-align: center;
			margin: 0 auto;
			margin-top: 120rpx;
		}
	}
}
</style>
